package com.buanalintas.sandals.pos.entities;

import com.buanalintas.bynga.entities.MasterUnit;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

@Entity
@Table(name = "pos_transaction_sale_shop_detail")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PosTransactionSaleShopDetail.findAll", query = "SELECT p FROM PosTransactionSaleShopDetail p"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySync", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.sync = :sync"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailId", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailId = :saleShopDetailId"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailSaleShopId", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailSaleShopId = :saleShopDetailSaleShopId"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailItemId", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailItemId = :saleShopDetailItemId"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailQuantity", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailQuantity = :saleShopDetailQuantity"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailPriceBuy", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailPriceBuy = :saleShopDetailPriceBuy"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailPrice", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailPrice = :saleShopDetailPrice"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailDiscountPercent", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailDiscountPercent = :saleShopDetailDiscountPercent"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailDiscountNominal", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailDiscountNominal = :saleShopDetailDiscountNominal"),
    @NamedQuery(name = "PosTransactionSaleShopDetail.findBySaleShopDetailTotal", query = "SELECT p FROM PosTransactionSaleShopDetail p WHERE p.saleShopDetailTotal = :saleShopDetailTotal")})
public class PosTransactionSaleShopDetail implements Serializable {

    private static final long serialVersionUID = 1L;
    @Column(name = "sync")
    private String sync;
    @Id
    @Basic(optional = false)
    @Column(name = "sale_shop_detail_id")
    private Integer saleShopDetailId;
    @Column(name = "sale_shop_detail_size")
    private String saleShopDetailSize;
    @Column(name = "sale_shop_detail_quantity")
    private Integer saleShopDetailQuantity;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "sale_shop_detail_price_buy")
    private BigDecimal saleShopDetailPriceBuy;
    @Column(name = "sale_shop_detail_price")
    private BigDecimal saleShopDetailPrice;
    @Column(name = "sale_shop_detail_discount_percent")
    private BigDecimal saleShopDetailDiscountPercent;
    @Column(name = "sale_shop_detail_discount_nominal")
    private BigDecimal saleShopDetailDiscountNominal;
    @Column(name = "sale_shop_detail_total")
    private BigDecimal saleShopDetailTotal;
    @JoinColumn(name = "sale_shop_detail_sale_shop_id", referencedColumnName = "sale_shop_id")
    @ManyToOne(optional = false)
    private PosTransactionSaleShop saleShopDetailSaleShopId;
    @JoinColumn(name = "sale_shop_detail_item_id", referencedColumnName = "item_id")
    @ManyToOne(optional = false)
    private PosMasterItem saleShopDetailItemId;
    @JoinColumn(name = "sale_shop_detail_size_id", referencedColumnName = "size_id")
    @ManyToOne(optional = false)
    private PosMasterSize saleShopDetailSizeId;

    public PosTransactionSaleShopDetail() {
    }

    public PosTransactionSaleShopDetail(Integer saleShopDetailId) {
        this.saleShopDetailId = saleShopDetailId;
    }

    public String getSync() {
        return sync;
    }

    public void setSync(String sync) {
        this.sync = sync;
    }

    public String getSaleShopDetailSize() {
        return saleShopDetailSize;
    }

    public void setSaleShopDetailSize(String saleShopDetailSize) {
        this.saleShopDetailSize = saleShopDetailSize;
    }

    public PosMasterSize getSaleShopDetailSizeId() {
        return saleShopDetailSizeId;
    }

    public void setSaleShopDetailSizeId(PosMasterSize saleShopDetailSizeId) {
        this.saleShopDetailSizeId = saleShopDetailSizeId;
    }

    public Integer getSaleShopDetailId() {
        return saleShopDetailId;
    }

    public void setSaleShopDetailId(Integer saleShopDetailId) {
        this.saleShopDetailId = saleShopDetailId;
    }

    public PosMasterItem getSaleShopDetailItemId() {
        return saleShopDetailItemId;
    }

    public void setSaleShopDetailItemId(PosMasterItem saleShopDetailItemId) {
        this.saleShopDetailItemId = saleShopDetailItemId;
    }

    public PosTransactionSaleShop getSaleShopDetailSaleShopId() {
        return saleShopDetailSaleShopId;
    }

    public void setSaleShopDetailSaleShopId(PosTransactionSaleShop saleShopDetailSaleShopId) {
        this.saleShopDetailSaleShopId = saleShopDetailSaleShopId;
    }

    public Integer getSaleShopDetailQuantity() {
        return saleShopDetailQuantity;
    }

    public void setSaleShopDetailQuantity(Integer saleShopDetailQuantity) {
        this.saleShopDetailQuantity = saleShopDetailQuantity;
    }

    public BigDecimal getSaleShopDetailPriceBuy() {
        return saleShopDetailPriceBuy;
    }

    public void setSaleShopDetailPriceBuy(BigDecimal saleShopDetailPriceBuy) {
        this.saleShopDetailPriceBuy = saleShopDetailPriceBuy;
    }

    public BigDecimal getSaleShopDetailPrice() {
        return saleShopDetailPrice;
    }

    public void setSaleShopDetailPrice(BigDecimal saleShopDetailPrice) {
        this.saleShopDetailPrice = saleShopDetailPrice;
    }

    public BigDecimal getSaleShopDetailDiscountPercent() {
        return saleShopDetailDiscountPercent;
    }

    public void setSaleShopDetailDiscountPercent(BigDecimal saleShopDetailDiscountPercent) {
        this.saleShopDetailDiscountPercent = saleShopDetailDiscountPercent;
    }

    public BigDecimal getSaleShopDetailDiscountNominal() {
        return saleShopDetailDiscountNominal;
    }

    public void setSaleShopDetailDiscountNominal(BigDecimal saleShopDetailDiscountNominal) {
        this.saleShopDetailDiscountNominal = saleShopDetailDiscountNominal;
    }

    public BigDecimal getSaleShopDetailTotal() {
        return saleShopDetailTotal;
    }

    public void setSaleShopDetailTotal(BigDecimal saleShopDetailTotal) {
        this.saleShopDetailTotal = saleShopDetailTotal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (saleShopDetailId != null ? saleShopDetailId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PosTransactionSaleShopDetail)) {
            return false;
        }
        PosTransactionSaleShopDetail other = (PosTransactionSaleShopDetail) object;
        if ((this.saleShopDetailId == null && other.saleShopDetailId != null) || (this.saleShopDetailId != null && !this.saleShopDetailId.equals(other.saleShopDetailId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.buanalintas.sandals.pos.entities.PosTransactionSaleShopDetail[ saleShopDetailId=" + saleShopDetailId + " ]";
    }
}
